using Universal.Application.Contracts.Common;
using Universal.Application.Contracts.Dto.Article;

namespace Universal.Application.Repositories;

/// <summary>
/// 文章服务
/// </summary>
public interface IArticleService
{
    /// <summary>
    /// 获取文章分页列表
    /// </summary>
    Task<ApiResponse<PagedResult<ArticleDto>>> GetArticlesPagedAsync(int pageIndex, int pageSize);

    /// <summary>
    /// 根据条件查询文章
    /// </summary>
    Task<ApiResponse<PagedResult<ArticleDto>>> QueryArticlesAsync(ArticleQueryDto query);

    /// <summary>
    /// 获取单个文章详情
    /// </summary>
    Task<ApiResponse<ArticleDto?>> GetArticleByIdAsync(Guid id);

    /// <summary>
    /// 创建文章
    /// </summary>
    Task<ApiResponse<ArticleDto>> CreateArticleAsync(CreateArticleDto dto, Guid userId);

    /// <summary>
    /// 更新文章
    /// </summary>
    Task<ApiResponse<bool>> UpdateArticleAsync(UpdateArticleDto dto);

    /// <summary>
    /// 删除文章
    /// </summary>
    Task<ApiResponse<bool>> DeleteArticleAsync(Guid id);

    /// <summary>
    /// 更新文章状态
    /// </summary>
    Task<ApiResponse<bool>> UpdateArticleStatusAsync(Guid id, int status);
}